package ge.tsu.java.project.commons;

public abstract class Logger {

	private static int instanceCount = 0;

	public static Logger getInstance(Class<?> klass) {
		return getInstance(klass != null ? klass.getName() : null);
	}

	public static Logger getInstance(String tag) {
		// TODO make it configurable without changing source
		instanceCount++;
		if (tag == null) {
			tag = "Logger - " + instanceCount;
		}
		return new SimpleLogger(tag);
	}

	public abstract void log(String message);

	public abstract void err(String message);

	public abstract void err(Throwable t);

	public abstract void err(String message, Throwable t);

	/** Logs error and exits JVM **/
	public abstract void severe(Throwable t);

	/** Logs error and exits JVM **/
	public abstract void severe(String message, Throwable t);

}
